package com.dnjn.happiness.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dnjn.happiness.biz.domain.Moments;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 圈子 Mapper 接口
 * </p>
 *
 * @author Amber
 * @since 2023-10-04
 */
public interface MomentsMapper extends BaseMapper<Moments> {

    Moments selectOneById(Long id);

    Page<Moments> selectPageX(@Param("po") Moments domain, Page page);

    @Select("SELECT COUNT(*) FROM `biz_moments` WHERE  TO_DAYS(date_current) = TO_DAYS(NOW()) AND user_id = #{userId}")
    Integer selectCount(Long userId);
}
